package basicas;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import util.ObjetoSistema;

@Entity
public class Expertises {

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private int codExpertise;
	private String nome;
	private int nivel;
	@ManyToMany
	@JoinTable(name = "aluno_expertise", joinColumns = { @JoinColumn(name = "codExpertise") }, inverseJoinColumns = { @JoinColumn(name = "codAluno") })
	@Cascade(CascadeType.ALL)
	private List<Aluno> aluno;
	@ManyToMany
	@JoinTable(name = "projeto_expertises", joinColumns = { @JoinColumn(name = "codExpertise") }, inverseJoinColumns = { @JoinColumn(name = "codProjeto") })
	@Cascade(CascadeType.ALL)
	private List<Projeto> projetos;

	public Expertises() {
	}

	public int getCodExpertise() {
		return codExpertise;
	}

	public void setCodExpertise(int codExpertise) {
		this.codExpertise = codExpertise;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public int getNivel() {
		return nivel;
	}

	public void setNivel(int nivel) {
		this.nivel = nivel;
	}

	public List<Aluno> getAluno() {
		return aluno;
	}

	public void setAluno(List<Aluno> aluno) {
		this.aluno = aluno;
	}

	public List<Projeto> getProjetos() {
		return projetos;
	}

	public void setProjetos(List<Projeto> projetos) {
		this.projetos = projetos;
	}

}
